<template>
	<view>
		<view class="score-container">
			<view class="title">2021春季学期 成绩单</view>
			<view class="score-list">
				<view v-for="(score, index) in scores.lastspring" :key="index" class="score-item">
					<view class="course">{{ score.course }}</view>
					<view class="grade">{{ score.grade }}--</view>
					<view class="credit"> 学分{{ score.credit }}--绩点</view>
					<view class="gpa">{{ score.gpa }}--</view>
					<view class="teacher">{{ score.teacher }}</view>
				</view>
			</view>
		</view>
		<view class="score-container">
			<view class="title">2021秋季学期 成绩单</view>
			<view class="score-list">
				<view v-for="(score, index) in scores.lastautumn" :key="index" class="score-item">
					<view class="course">{{ score.course }}</view>
					<view class="grade">{{ score.grade }}--</view>
					<view class="credit"> 学分{{ score.credit }}--绩点</view>
					<view class="gpa">{{ score.gpa }}--</view>
					<view class="teacher">{{ score.teacher }}</view>
				</view>
			</view>
		</view>
		<view class="score-container">
			<view class="title">2022春季学期 成绩单</view>
			<view class="score-list">
				<view v-for="(score, index) in scores.spring" :key="index" class="score-item">
					<view class="course">{{ score.course }}</view>
					<view class="grade">{{ score.grade }}--</view>
					<view class="credit"> 学分{{ score.credit }}--绩点</view>
					<view class="gpa">{{ score.gpa }}--</view>
					<view class="teacher">{{ score.teacher }}</view>
				</view>
			</view>
		</view>
		<view class="score-container">
			<view class="title">2022秋季学期 成绩单</view>
			<view class="score-list">
				<view v-for="(score, index) in scores.autumn" :key="index" class="score-item">
					<view class="course">{{ score.course }}</view>
					<view class="grade">{{ score.grade }}--</view>
					<view class="credit"> 学分{{ score.credit }}--绩点</view>
					<view class="gpa">{{ score.gpa }}--</view>
					<view class="teacher">{{ score.teacher }}</view>
				</view>
			</view>
		</view>
		<view class="score-container">
			<view class="title">2023春季学期 成绩单</view>
			<view class="score-list">
				<view v-for="(score, index) in scores.nextspring" :key="index" class="score-item">
					<view class="course">{{ score.course }}</view>
					<view class="grade">{{ score.grade }}--</view>
					<view class="credit"> 学分{{ score.credit }}--绩点</view>
					<view class="gpa">{{ score.gpa }}--</view>
					<view class="teacher">{{ score.teacher }}</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				scores: {
					lastspring: [{
							course: '数学',
							grade: 90,
							credit: 4,
							gpa: 3.6,
							teacher: '张老师'
						},
						{
							course: '英语',
							grade: 85,
							credit: 3,
							gpa: 3.2,
							teacher: '李老师'
						},
						{
							course: '物理',
							grade: 95,
							credit: 4,
							gpa: 3.8,
							teacher: '王老师'
						},
						{
							course: '化学',
							grade: 88,
							credit: 4,
							gpa: 3.6,
							teacher: '张老师'
						},
					],
					lastautumn: [{
							course: '物理',
							grade: 95,
							credit: 4,
							gpa: 3.6,
							teacher: '张老师'
						},
						{
							course: '化学',
							grade: 88,
							credit: 4,
							gpa: 3.6,
							teacher: '张老师'
						},
						{
							course: '数学',
							grade: 90,
							credit: 4,
							gpa: 3.6,
							teacher: '张老师'
						},
						{
							course: '英语',
							grade: 85,
							credit: 3,
							gpa: 3.2,
							teacher: '李老师'
						},
					],
					spring: [{
							course: '数学',
							grade: 90,
							credit: 4,
							gpa: 3.6,
							teacher: '张老师'
						},
						{
							course: '英语',
							grade: 85,
							credit: 3,
							gpa: 3.2,
							teacher: '李老师'
						},
						{
							course: '物理',
							grade: 95,
							credit: 4,
							gpa: 3.8,
							teacher: '王老师'
						},
						{
							course: '化学',
							grade: 88,
							credit: 4,
							gpa: 3.6,
							teacher: '张老师'
						},
					],
					autumn: [{
							course: '物理',
							grade: 95,
							credit: 4,
							gpa: 3.6,
							teacher: '张老师'
						},
						{
							course: '化学',
							grade: 88,
							credit: 4,
							gpa: 3.6,
							teacher: '张老师'
						},
						{
							course: '数学',
							grade: 90,
							credit: 4,
							gpa: 3.6,
							teacher: '张老师'
						},
						{
							course: '英语',
							grade: 85,
							credit: 3,
							gpa: 3.2,
							teacher: '李老师'
						},
					],
					nextspring: [{
							course: '数学',
							grade: 90,
							credit: 4,
							gpa: 3.6,
							teacher: '张老师'
						},
						{
							course: '英语',
							grade: 85,
							credit: 3,
							gpa: 3.2,
							teacher: '李老师'
						},
						{
							course: '物理',
							grade: 95,
							credit: 4,
							gpa: 3.8,
							teacher: '王老师'
						},
						{
							course: '化学',
							grade: 88,
							credit: 4,
							gpa: 3.6,
							teacher: '张老师'
						},
					],
				}
			};
		}
	};
</script>
<style>
	.score-container {
		padding: 20rpx;
	}
	.title {
		font-size: 24rpx;
		font-weight: bold;
		margin-bottom: 20rpx;
	}
	.score-list {
		border: 1rpx solid #ccc;
	}
	.score-item {
		display: flex;
		align-items: center;
		padding: 10rpx;
		border-bottom: 1rpx solid #ccc;
	}
	.course {
		flex: 1;
	}
	.grade {
		font-weight: bold;
	}
</style>